﻿#ifndef BUFFEREDSTREAEM_H
#define BUFFEREDSTREAEM_H
#include "Stream.h"

class BufferedStreaem:public Stream
{
private:
    Stream* m_pStream;
public:
    BufferedStreaem(Stream* stm):m_pStream(stm){

    };
    virtual char Read(int number)
    {
        //额外的缓存操作
        m_pStream->Read(12);
        cout<<"this is a BufferedStreaem Read"<<endl;
        return 0;
    };//读取
    virtual void Seek(int position)
    {
        //额外的缓存操作
        cout<<"this is a BufferedStreaem Seek"<<endl;
        m_pStream->Seek(12);
    };//寻找，定位
    virtual void Write(char data)
    {
        //额外的缓存操作
         cout<<"this is a BufferedStreaem Write"<<endl;
        m_pStream->Seek(12.0);
    };//写入
};

#endif // BUFFEREDSTREAEM_H
